﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Imaginecup.gameState.malaria;
using Imaginecup.gameState.temp;
using Imaginecup.gameState.malaria.stage;
using Imaginecup.gameState.malaria.stageMan;
using Imaginecup.Recycling;
using Imaginecup.gameState.ending;
using Imaginecup.gameState.startBtnState;
using Imaginecup.gameState.darkRain.stageMan;
using Imaginecup.gameState.option;
using Imaginecup.gameState.menu;
using Imaginecup.gameState.water;
namespace Imaginecup.factory
{
  //  public enum StateFactoryID { StateID_StartState, StateID_Game1 };
    
    //Sington으로 팩토리 객체 관리.
    public class StateFactory: IFactory
    {
        private static StateFactory m_StateFactory = null;
        private StateFactory()
        {

        }

        public static StateFactory GetStateFactory()
        {
            if( m_StateFactory == null )
            {
                m_StateFactory = new StateFactory();
            }
            return m_StateFactory;
        }

        public Object GetObject(Object id)
        {
            StateFactoryID stateID = (StateFactoryID)id;

            switch( stateID )
            {          
                case StateFactoryID.State_Malaria:
                    MalariaState state = MalariaState.GetMalariaState();
                    return state;
                    
                case StateFactoryID.State_Title:
                    return Title.GetTitle();

                case StateFactoryID.State_Option:
                    return OptionState.GetOptionState();

                case StateFactoryID.State_Option_Reset:
                    return ResetState.GetOptionResetState();

                case StateFactoryID.State_Menu:
                    return MenuState.GetMenuState();

                case StateFactoryID.State_Ending:
                    return GameEnding.GetEnding();        

                case StateFactoryID.State_RecycleGame:
                    return new RecycleGameState();
                    
                case StateFactoryID.State_TitleMenu:
                    return Title_Menu.GetTitleMenu();

                case StateFactoryID.State_Intro:
                    return GameIntro.GetGameIntro();

                case StateFactoryID.State_RainGame:

                    DarkRainState rainState = DarkRainState.GetRainState();
                    rainState.SetStageMan(new DarkStageMan(new DarkRainStageFactory()));
                    return rainState;

                case StateFactoryID.State_StartBtn:
                    return StartBtnState.GetStartBtnState();

                case StateFactoryID.State_ChoiceMap:
                    return ChoiceMap.GetChoiceMap();

                case StateFactoryID.State_WaterGame:
                    return WaterState.GetWaterState();


           
            }

            return null;
        }
    }
}
